package com.itheima.ssm.dao;


import com.itheima.ssm.vo.Permission;
import com.itheima.ssm.vo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);


    //==============================


    void save(Role role);

    List<Role> findAll();

    public List<Role> findRoleByUserId(String userId);

    Role findById(String roleId);

    List<Permission> findOtherPermissions(String roleId);

    void addPermissionToRole(@Param("roleId") String roleId, @Param("permissionId") String permissionId);

    void deleteFromUser_RoleByRoleId(String roleId);


    void deleteFromRole_PermissionByRoleId(String roleId);


    void deleteRoleById(String roleId);

}